#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    :  
# @function: 
# @version :


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains  # 动作链


browser = webdriver.Chrome()
browser.get('https://www.runoob.com/try/try.php?filename=jqueryui-api-droppable')
log = browser.find_element(By.XPATH, '//*[@id="iframeResult"]')
browser.switch_to.frame(log)
source = browser.find_element(By.CSS_SELECTOR, '#draggable')
target = browser.find_element(By.CSS_SELECTOR, '#droppable')
actions = ActionChains(browser)
# 传递两个参数，第一个是拖拽的起点，第二个是拖拽的终点
actions.drag_and_drop(source, target)
actions.perform()
browser.quit()
